package com.aaron.test;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @author liurong
 * @date 2021/9/2 10:57
 * @version:
 */
public class TTTxx {

    int a;

    public static void swap(List<Integer> list) {
        int i1 = list.get(0);
        int i2 = list.get(1);
        list.set(0,i2);
        list.set(1,i1);
    }

    public static void main(String[] args) {

//        Date start = new Date();
//        Calendar calendar = Calendar.getInstance();
//        calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) - 1, 0, 0, -1);
//        start = calendar.getTime();
////        start.setSeconds(-1);
//        System.out.println(start);
//        List<Integer> list = Arrays.asList(1, 2);
//        swap(list);
//        list.forEach(System.out::println);


//        Date date1 = new Date("2021-01-01 00:00:00");
//        Date date2 = new Date("2021-02-01 00:00:00");
        DateTime dateTime1 = DateUtil.parse("2021-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss");
        DateTime dateTime2 = DateUtil.parse("2021-02-01 00:00:00", "yyyy-MM-dd HH:mm:ss");

        Date date1 = dateTime1.toJdkDate();
        Date date2 = dateTime2.toJdkDate();

//        List<Object> ans =
//        Map<Object, Object> ans =
//        String ans =
//                Arrays.asList(date1, date2).stream().map(t -> DateUtil.format(t, "yyyy-MM"))
//                .collect(Collectors.toList());

//                .collect(Collectors.toMap(x->x,(tt)->0));
//                        .reduce("",(t,tt)->{
//                            if (t.equals("")) {
//                                return tt;
//                            }
//                            return t + "  " + tt;
//                        });
//                        .reduce(new HashMap<String,String>(),(t,tt)->{
//
//                });

//        ans.forEach(System.out::println);
//        for (Map.Entry<Object, Object> entry : ans.entrySet()) {
//            System.out.println(entry.getKey()+":"+entry.getValue());
//        }
//        System.out.println(ans);

    }



}

